﻿using System;
using MongoDB.Bson.Serialization.Attributes;

namespace DotNet.Utilities.MongoDB
{
    public class EntityBase
    {
        /// <summary>
        /// 主键(GUID)
        /// </summary>
        [BsonId]
        public string Id { get; set; }

        /// <summary>
        /// 创建时间（使用 MongoDbHelper.GetDateTimeForMongoDb() 进行赋值）
        /// </summary>
        //[BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新时间（使用 MongoDbHelper.GetDateTimeForMongoDb() 进行赋值）
        /// </summary>
        //[BsonDateTimeOptions(Kind = DateTimeKind.Local)]
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 软删除
        /// </summary>
        public bool IsDeleted { get; set; }
    }
}
